/**
 * @Title: package-info
 * @Author: linchong
 * @Desc: interruptThread
 * @Email:littlexbear@163.com
 * @Create: 2020/1/4 9:04
 * @CopyRight(C) https://blog.csdn.net/littlexbear
 **/
package com.linchong.concurrency.chapter6;
/**
 * 1.中断线程操作：interrupted
 * wait:使用wait时，必须给他一个monitor,且该monitor必须要
 * 使用Synchronized进行包装。
 * stop:已废弃，强制退出，引发SecurityManagerException,禁用
 * isInterrupted:判断当前线程状态是否被中断
 * sleep:
 * join:
 * If this thread is blocked in an invocation of the wait(), wait(long),
 * or wait(long, int) methods of the Object class, or of the join(), join(long),
 * join(long, int), sleep(long), or sleep(long, int),methods of this class,
 * then its interrupt status will be cleared and it will receive an InterruptedException.
 * <p>
 * 2.优雅的结束线程生命周期：
 * a.通过开关的方式，使用volatile关键字，
 * 使用场景：多线程处理，某一线程结束后，结束
 * <p>
 * b.通过打断的方式，
 **/